<?php
/**
 * Created by PhpStorm.
 */

use Biz\service\activity\Coupon as sCoupon;
/**
 * @deprecated
 */
class SelectListAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_REGISTER;
    const ACTION_TYPE = "coupon";
    const VERSION_METHOD = true;


    private $tabId = 0;
    private $skuToken = '';
    private $sCouponListJson = '';
    private $mealId = 0;

    public function main()
    {
        $this->tabId = $this->getRequest()->getPost('tab_id', 0);
        $this->skuToken = $this->getRequest()->getPost('sku_token', '');
        $this->sCouponListJson = $this->getRequest()->getPost('s_coupon_list', '');
        $this->mealId = $this->getRequest()->getPost('meal_id', '');


        $this->returnFunc();
    }

    public function main_V3_5_2()
    {
        $this->tabId = $this->getRequest()->getQuery('tab_id', 0);
        $this->skuToken = $this->getRequest()->getQuery('sku_token', '');

        $this->returnFunc();
    }

    private function returnFunc(){

        $result = sCoupon::getSelectList($this->uid, $this->tabId, $this->skuToken, $this->sCouponListJson,$this->mealId);

        $this->setSuccess(['list' => $result]);

    }

}
